import axios from "@/utils/request";
// 文章-不感兴趣
export const dislikeArticleApi = (articleid) => {
    return axios({
        method: "POST",
        url: "/v1_0/article/dislikes",
        data: {
            target: articleid,
        },
    });
};
//文章-举报
export const reportArticleApi = (articleid, type, remark) => {
    return axios({
        method: "POST",
        url: "/v1_0/article/reports",
        data: {
            target: articleid,
            type,
            remark,
        },
    });
};
//文章-详情
export const getArticleDetailApi = (id) => {
    return axios({
        method: "GEt",
        url: `/v1_0/articles/${id}`,
    });
};
// 文章 - 关注作者
export const getConcernApi = (target) => {
    return axios({
        method: "POST",
        url: "/v1_0/user/followings",
        data: {
            target,
        },
    });
};
// 文章 - 取消关注CancelApi
export const getCancelApi = (id) => {
    return axios({
        method: "DELETE",
        url: `/v1_0/user/followings/${id}`,
    });
};
// 文章 - 喜欢
export const getLikeApi = (target) => {
    return axios({
        method: "POST",
        url: "/v1_0/article/likings",
        data: {
            target,
        },
    });
};
// 文章 - 不喜欢
export const getUnlikeApi = (id) => {
    return axios({
        method: "DELETE",
        url: `/v1_0/article/likings/${id}`,
    });
};
// 获取评论列表
export const getReviewsApi = (source, offset, limit) => {
    return axios({
        method: "GET",
        url: "/v1_0/comments",
        params: {
            type: "a",
            source,
            offset,
            limit,
        },
    });
};
// 点赞
export const likeReviewsApi = (id) => {
    return axios({
        method: "POST",
        url: "/v1_0/comment/likings",
        data: {
            target: id,
        },
    });
};
// 取消点赞
export const unlikeReviewsApi = (id) => {
    return axios({
        method: "DELETE",
        url: `/v1_0/comment/likings/${id}`,
    });
};
// 发表评论
export const getLeaveComment = (artidm, content) => {
    return axios({
        method: "POST",
        url: "/v1_0/comments",
        data: {
            target: artidm,
            content,
        },
    });
};